home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1 / Ian and Stuart's One (Australia).iso / Australasian Legends / Commercial / Rainbow Hill / MacDOS™ 2.0.0 / batches / remove.bat < prev    next >
DOS Batch File  |  1994-06-30  |  618b  |  32 lines

  1. @echo off
  2. !  remove.bat    Batch file to delete a folder or a file
  3. !
  4. !  remove name
  5. !
  6. !  where 'name' is the item to be deleted. The name can be preceded by
  7. !  a path and a volume ID.
  8. !
  9. !  remove.bat calls deldir
  10. !
  11. !  Copyright © 1994 by Rainbow Hill Pty Ltd. All rights reserved.
  12. !
  13.  
  14.     ! ensure that the first parameter is there and that the second one is not
  15.     set doserr=13
  16.     if not "%2 " == " " goto ERR_LBL
  17.     if "%1 " == " " goto ERR_LBL
  18.  
  19.     ! do the deleting
  20.     onerror ERR_LBL
  21.     if not existdir "%1" goto DEL_FILE_LBL
  22.     deldir "%1"
  23.     goto DONE_LBL
  24. :DEL_FILE_LBL
  25.     del "%1"
  26.     goto DONE_LBL
  27.  
  28. :ERR_LBL
  29.     show %doserr%
  30.  
  31. :DONE_LBL
  32.